﻿using System;
using System.Collections.Generic;
using Microsoft.BusinessData.MetadataModel;
using Microsoft.BusinessData.MetadataModel.Collections;

namespace BdcRestConnector.Tests
{
    public class MyParameters : IParameterCollection
    {
        private readonly List<IParameter> _parameters;

        public MyParameters(params IParameter[] parameters)
        {
            _parameters = new List<IParameter>(parameters);
        }

        public bool Contains(IParameter item)
        {
            return _parameters.Contains(item);
        }

        public void CopyTo(IParameter[] array, int arrayIndex)
        {
            throw new NotImplementedException();
        }

        public int Count
        {
            get { return _parameters.Count; }
        }

        public IParameter this[int index]
        {
            get { return _parameters[index]; }
        }

        public IEnumerator<IParameter> GetEnumerator()
        {
            return _parameters.GetEnumerator();
        }

        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
        {
            return _parameters.GetEnumerator();
        }
    }
}
